package com.tcenter.dao.entities;


import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 * 
 */
@Embeddable
public class UserRoleId implements java.io.Serializable {

    private Integer userId;
    private Integer roleId;


    public UserRoleId() {
    }

    public UserRoleId(Integer userId, Integer roleId) {
        this.userId = userId;
        this.roleId = roleId;
    }


    @Column(name = "user_id", nullable = false)
    public Integer getUserId() {
        return this.userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    @Column(name = "role_id", nullable = false)
    public Integer getRoleId() {
        return this.roleId;
    }

    public void setRoleId(Integer roleId) {
        this.roleId = roleId;
    }


    public boolean equals(Object other) {
        if ((this == other))
            return true;
        if ((other == null))
            return false;
        if (!(other instanceof UserRoleId))
            return false;
        UserRoleId castOther = (UserRoleId) other;

        return (this.getUserId() == castOther.getUserId())
                && (this.getRoleId() == castOther.getRoleId());
    }

    public int hashCode() {
        Integer result = 17;
        result = 37 * result + this.getUserId();
        result = 37 * result + this.getRoleId();
        return result;
    }

}
